﻿#include <QCoreApplication>

#include "concretefactory1.h"
#include "concretefactory2.h"

#include "concreteproducta1.h"
#include "concreteproductb1.h"
#include "concreteproducta2.h"
#include "concreteproductb2.h"
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    ConcreteFactory1 factory1;
    AbstractProductA* producta1 = factory1.createProductA();
    producta1->use();
    AbstractProductB* productb1 = factory1.createProductB();
    productb1->eat();

    delete producta1;
    delete productb1;

    ConcreteFactory2 factory2;
    AbstractProductA* producta2 = factory2.createProductA();
    producta2->use();
    AbstractProductB* productb2 = factory2.createProductB();
    productb2->eat();

    delete producta2;
    delete productb2;

    return a.exec();
}
